package cn.zwx.base.enums;

import lombok.Getter;

/**
 * @author zhangwenxue
 */
@Getter
public enum ResponseCodeEnum {
    /**
     * 成功
     */
    SUCCESS(0, "请求成功!"),

    RPC_ERROR(10001, "rpc异常!"),

    PERIOD_ERROR(10002,"限流错误"),

    PERIOD_LIMITER_ERROR(10003,"您当前访问太频繁,请稍后重试"),
    PARAMS_VALID_ERROR(10004,"请求参数错误"),
    MQ_INIT_TRANSACTION_ERROR(10005,"事务消息mq生产者初始化异常"),
    MQ_INIT_ERROR(10006,"普通消息mq生产者初始化异常"),
    SEND_MQ_ERROR(10007,"发送消息异常"),
    SUBSCRIBE_MQ_ERROR(10008,"订阅消息异常"),
    CONSUMER_START_MQ_ERROR(10009,"消费者启动失败异常"),
    CALL_NOT_PERMITTED_ERROR(10010,"服务繁忙,请求稍后重试"),
    LIMITER_NOT_PERMITTED_ERROR(10011,"您当前请求太过频繁,请求稍后重试"),
    REDISSON_LOCK_TYPE_ERROR(10012,"分布式锁不支持类"),
    REDISSON_TRY_LOCK_ERROR(10013,"获取分布式锁异常"),
    UNKNOWN_ERROR(10014,"未知异常"),
    REDISSON_LOCK_KEY_ERROR(10015,"分布式锁key配置错误"),
    REQUEST_PARMA_ERROR(10016,"请求参数错误,请检查参数"),
    FILE_UPLOAD_SIZE_LIMIT_ERROR(10017,"文件上传过大"),
    PARAM_PARSE_ERROR(10018,"参数解析异常,请检查参数"),
    SERVICE_NOT_PERMITTED_ERROR(10019,"服务开小差,请稍后重试"),
    SERVICE_RESOURCE_LIMIT_ERROR(10020,"服务器资源不足,请稍后重试"),
    SERVICE_PERMISSION_ERROR(10020,"服务授权不通过"),

    ;

    private final int code;
    private final String msg;

    ResponseCodeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

}
